package org.genesilico.workflow2.graphs;

public class GraphNode {
	/* numbers of this node in the graph */
	public int myNumber;
	public Node content;
	/* numbers of graph nodes from which the edge is going to this node */
	public int[] parents;
	/* numbers of graph nodes to which and edge is going from this node */
	public int[] children;

	public GraphNode(final int myNumber, final Node content,
			final int[] parents, final int[] children) {
		this.myNumber = myNumber;
		this.content = content;
		this.parents = parents;
		this.children = children;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append(myNumber).append(" {");
		for (int child : children) {
			sb.append(child).append(" ");
		}
		sb.append("} {");
		for (int parent : parents) {
			sb.append(parent).append(" ");
		}
		sb.append("}");
		return sb.toString();
	}
}
